
from selenium import webdriver
from scrapy.selector import Selector
#引入谷歌的webdriver驱动
browser = webdriver.Chrome(executable_path="E:/testSvn/python/notes/chromeDriver/chromedriver.exe")
browser.get("https://www.zhihu.com/signup")#获取知乎登录页
browser.find_element_by_css_selector(".view-signin input[name='account']").send_keys("18946762047")#写入账号
browser.find_element_by_css_selector(".view-signin input[name='password']").send_keys("jinmingyu569")#写入密码

browser.find_element_by_css_selector(".view-signin button.sign-button").click()

# print(browser.page_source)#打印浏览器控制台代码
# t_selecter = Selector(text=browser.page_source)
# print(t_selecter.css(".tm-promo-price .tm-price::text").extract())



# browser.quit()#关闭打开的浏览器